<template>
    <el-aside :width="$store.state.isCollapsed ? '64px' : '200px'">

        <el-menu :collapse="$store.state.isCollapsed" :collapse-transition="false" :router="true"
            :default-active="route.fullPath">
            <!-- collapse:收起侧边栏状态  collapse-transition:收起动画  router:按index查找路径功能开启  defaut-active:默认激活高亮显示项 -->
            <!-- <el-menu-item index="/index">
                <el-icon>
                    <home-filled />
                </el-icon>
                <span>首页</span>
            </el-menu-item> -->

            <el-menu-item index="/center" >
                <el-icon>
                    <avatar />
                </el-icon>
                <span>个人中心</span>
            </el-menu-item>

            <el-sub-menu index="/prepare" v-if="store.state.userInfo.role==='学生'">
                <template #title>
                    <el-icon>
                        <Edit />
                    </el-icon>
                    <span>准备</span>
                </template>
                <el-menu-item index="/prepare/material">资料查看</el-menu-item>
                <el-menu-item index="/prepare/cvmaker">简历制作</el-menu-item>
            </el-sub-menu>

            <el-menu-item index="/cvpost" v-if="store.state.userInfo.role==='学生'">
                <el-icon>
                    <Suitcase />
                </el-icon>
                <span>简历投递</span>
            </el-menu-item>

            <el-menu-item index="/comment" v-if="store.state.userInfo.role==='学生'">
                <el-icon>
                    <Suitcase />
                </el-icon>
                <span>简历评价</span>
            </el-menu-item>

            <el-menu-item index="/information-manage/add" v-if="store.state.userInfo.role==='教师'">
                <el-icon>
                    <Edit />
                </el-icon>
                <span>信息添加</span>
            </el-menu-item>

            <el-menu-item index="/information-manage/materialAdd" v-if="store.state.userInfo.role==='教师'">
                <el-icon>
                    <Edit />
                </el-icon>
                <span>资料添加</span>
            </el-menu-item>

            <el-menu-item index="/information-manage/list" v-if="store.state.userInfo.role==='教师'">
                <el-icon>
                    <Edit />
                </el-icon>
                <span>信息列表</span>
            </el-menu-item>

            <el-menu-item index="/information-manage/materialList" v-if="store.state.userInfo.role==='教师'">
                <el-icon>
                    <Edit />
                </el-icon>
                <span>资料列表</span>
            </el-menu-item>

            

            

            
        </el-menu>

    </el-aside>
</template>

<script setup>
import { HomeFilled, Avatar, UserFilled, MessageBox, Reading, Pointer, Edit, Suitcase } from '@element-plus/icons-vue'
import { useRoute } from 'vue-router'
import { useStore } from 'vuex'
const identity = localStorage.getItem('identity')
const route = useRoute()
const store = useStore()
const vAdmin = {
    mounted(el){
        // console.log(el)
        if(store.state.userInfo.role!==1){
            el.parentNode.removeChild(el)
        }
        console.log(identity)
    }
}
</script>

<style lang="scss" scoped>
.el-aside {
    height: 100vh;
}
</style>